package com.huawei.appmarket.service.usercenter.personal.view.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import com.huawei.appmarket.service.usercenter.personal.view.card.PersonalCombineCard;
import com.huawei.appmarket.service.usercenter.personal.view.card.PersonalNormalCard;
import java.util.ArrayList;
import java.util.List;
import o.cht;
import o.der.d;
import o.der.g;

public class BasePersonalCombineNode extends cht {
    protected List<PersonalNormalCard> ˊ = new ArrayList();
    private LayoutInflater ᐝ;

    public BasePersonalCombineNode(Context context) {
        super(context, 1);
        ˎ();
        this.ᐝ = LayoutInflater.from(context);
    }

    protected void ˎ() {
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        View ʼ = ʼ();
        ʼ.findViewById(d.ﾟ).setVisibility(ˋ() ? 0 : 8);
        ˊ(ˋ(this.ᐝ, ʼ));
        ˊ(viewGroup, ʼ);
        return true;
    }

    protected boolean ˋ() {
        return true;
    }

    private View ʼ() {
        return this.ᐝ.inflate(g.ॱॱ, null);
    }

    private void ˊ(ViewGroup viewGroup, View view) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
        layoutParams.weight = 1.0f;
        viewGroup.addView(view, layoutParams);
    }

    protected boolean ॱॱ() {
        return true;
    }

    @NonNull
    private PersonalCombineCard ˋ(LayoutInflater layoutInflater, View view) {
        PersonalCombineCard personalCombineCard = new PersonalCombineCard(this.ॱ);
        personalCombineCard.ˏ(view);
        personalCombineCard.ˊ(ॱॱ());
        for (int i = 0; i < this.ˊ.size(); i++) {
            PersonalNormalCard personalNormalCard = (PersonalNormalCard) this.ˊ.get(i);
            personalNormalCard.ˏ((ViewGroup) layoutInflater.inflate(g.ʻ, null));
            personalCombineCard.ˊ(personalNormalCard);
        }
        return personalCombineCard;
    }
}
